package com.funasr.controller;

import com.funasr.service.RecognitionService;
import com.funasr.utils.SSLUtil;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.socket.*;
import org.springframework.web.socket.client.WebSocketClient;
import org.springframework.web.socket.client.standard.StandardWebSocketClient;

import java.io.IOException;
import java.util.concurrent.ExecutionException;

/**
 * @author niuyicong
 * @date 2025/10/19  10:31:14
 * @description
 */
@RestController
@RequestMapping("/recognition")
public class RecognitionController {

    private final RecognitionService recognitionService;

    public RecognitionController(RecognitionService recognitionService) {
        this.recognitionService = recognitionService;
    }

    @PostMapping("/testIO")
    public String testFunAsr(@RequestParam MultipartFile file) throws IOException, ExecutionException, InterruptedException {
        recognitionService.recognition(file);
        return "测试成功";
    }
}
